from typing import Dict, List

from pptx.chart.data import CategoryChartData


def render(chart_shape, data: Dict):
    chart = chart_shape.chart
    categories = data.get("categories") or []
    series = data.get("series") or []
    chart_data = CategoryChartData()
    chart_data.categories = categories
    for s in series:
        name = s.get("name")
        values = s.get("values") or []
        chart_data.add_series(name, values)
    chart.replace_data(chart_data)
    return True